package com.epro.dx.task;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import com.epro.dx.listenner.MyAsyncTaskListenner;
import com.epro.dx.util.ActivityUtil;
import com.epro.dx.util.OnekeyFilterLocalUtil;
import com.weipu.common.constants.ServerConstant;
import com.weipu.common.facade.exception.DxException;
import com.weipu.common.facade.factory.ProviderFactory;
import com.weipu.common.facade.model.CatelogModel;
import com.weipu.common.facade.model.OneKeyFilterResponseModel;
import com.weipu.common.facade.model.SalesLimitModel;
import com.weipu.common.util.StringUtil;

import android.content.Context;
import android.os.AsyncTask;
import android.util.Log;

/************************
 * @author Tony
 * @Date:2016-3-29下午3:33:10
 * @描述:获取用户一键过滤的设置信息的任务
 ************************/
public class SalesLimitAsyncTask extends AsyncTask<Void,Void,String> {

	private MyAsyncTaskListenner myAsyncTaskListenner;
	private Map<Integer, SalesLimitModel> tmpMap;
	private ArrayList<Integer> skus;
	public SalesLimitAsyncTask(MyAsyncTaskListenner myAsyncTaskListenner,ArrayList<Integer> skus){
		this.myAsyncTaskListenner = myAsyncTaskListenner;
		this.skus=skus;
	}
	@Override
	protected void onPreExecute() {
		myAsyncTaskListenner.onPreTask();
	}
	@Override
	protected String doInBackground(Void... params) {
		try {
			tmpMap = ProviderFactory.createProductProvider().getSaleslimit(skus);
		} catch (DxException e) {
			return e.getErrCode();
		}
		return "0";
	}
	@Override
	protected void onPostExecute(String result) {
		myAsyncTaskListenner.onPostTask(result, tmpMap);
	}

}
